import pymysql
zhangxin =pymysql.connect(user='root',password='123456',host='120.26.126.215',database='zhangxin',cursorclass =
pymysql.cursors.DictCursor)
cursor = zhangxin.cursor()
cursor.execute('select * from students')  #.execte 查询命令
# 根据数据库找到一条符合的一条数据
result = cursor.fetchone()
print(result)
